import Taro from '@tarojs/taro';

const accountInfo = Taro.getAccountInfoSync();
let baseUrlPrefix = ''
let timeout = 5000

// 这个写死的？？？
// dev  'n8KsTAwM'  test  'A0RGTAwM'    pre 'qbqutawm'   pro 'jbnrjy33'
let orgTag = 'n8KsTAwM'
let env = "trial"
if (accountInfo.miniProgram.envVersion) {
  env = accountInfo.miniProgram.envVersion
}

switch (env) {
  case 'develop':
    orgTag = 'n8KsTAwM'
    baseUrlPrefix = 'http://app.dev.hzddyy.com'
    // baseUrlPrefix = 'https://app.1daoto.hzddyy.com'
    // baseUrlPrefix = 'https://app.1daoto.com'

    break
  case 'trial':
    // orgTag = 'A0RGTAwM'
    orgTag = 'qbqutawm'
    // qbqutawm  --uat环境orgTag
    // baseUrlPrefix = 'http://app.test.hzddyy.com'//test

    baseUrlPrefix = 'https://app.1daoto.hzddyy.com' //uat
    // baseUrlPrefix = 'https://app.1daoto.com'//生产

    break
  case 'release':
    orgTag = 'jbnrjy33'
    baseUrlPrefix = 'https://app.1daoto.com'
    break
}

const api = {
  baseUrl: baseUrlPrefix,
  timeout,
  orgTag
  //其他相关变量
}

export default api
